<%--
  Created by IntelliJ IDEA.
  User: Smile
  Date: 2019/2/20
  Time: 14:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title>登录</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link href="resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <%--<link href="resources/bootstrap/css/bootstrap-huan.css" rel="stylesheet">--%>
    <link rel="stylesheet" href="resources/css/mobile-css/home.css" />

    <!-- Le styles -->
    <link href="resources/css/mobile-css/bootstrap.css" rel="stylesheet">
    <link href="resources/css/mobile-css/mobile-css.css" rel="stylesheet">
    <style type="text/css">
        body {
            padding-top: 60px;
            padding-bottom: 40px;
        }
    </style>
    <link href="resources/css/mobile-css/bootstrap-responsive.css" rel="stylesheet">
    <link rel="shortcut icon" href="<%=basePath%>resources/images/favicon.ico"/>
</head>
    <jsp:include page="mobile-header.jsp"/>
    <div class="container">
        <div class="hero-unit">
            <img src="resources/images/logo.png" />
        </div>
        <div id="login" class="container"  style="width: 100%;margin-top: 10%;">
            <div class="span4"></div>
            <div class="span4">
            <div class="panel panel-success">
                <div class="panel-heading" style="text-align: center">
                    <h2 class="panel-title">登录</h2>
                </div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" action="j_spring_security_check" method="post">
                        <div class="form-group">
                           <%-- <label for="username" class="col-sm-2 control-label">用户名:</label>--%>
                            <div class="col-sm-10">
                                <label for="username" style="display: inline-table;width: 15%" class="col-sm-2 control-label">用户名:</label>
                                <input style="height: 5%;" type="text" class="form-control" name="j_username" id="username" placeholder="请输入用户名">
                            </div>
                            <br/>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <label for="password" style="display: inline-table;width: 15%" class="col-sm-2 control-label">密码:</label>
                                <input style="height: 5%;" type="password" class="form-control" name="j_password" id="password" placeholder="请输入密码">
                            </div>
                        </div>
                        <br/>
                        <div class="form-group">
                            <div class="col-md-10">
                                <label style="display: inline-table;width: 15%" class="control-label col-md-2" for="validate_code">验证码:</label>
                                <input style="height: 5%;width: 45%" type="text" class="form-control" name="validate_code" id="validate_code">
                                <img alt="验证码" id="imagecode" src="image.jsp" onclick="changeVilidateCode(this)" title="点击图片刷新验证码" />
                            </div>
                        </div>
                        <br/>
                        <div class="form-group" style="text-align: center">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button style="width: 100%" type="submit" class="btn btn-default">登录</button>
                            </div>
                            <span class="form-message">${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}</span>
                        </div>
                    </form>
                </div>
            </div>
            </div>
        </div>
        <hr>

        <jsp:include page="footer.jsp"/>
    </div>

    <script type="text/javascript" src="resources/js/jquery/jquery-1.9.0.min.js"></script>
    <script type="text/javascript" src="resources/bootstrap/js/bootstrap.min.js"></script>
    <script>
        function changeVilidateCode() {
            var time = new Date().getTime();
            document.getElementById("imagecode").src="image.jsp?time="+time;
        }
    </script>
</body>
</html>
